<?php
# # # # # # # # # # # # # # # # # # # R O O T # # # # # # # # # # # # # # # # # # #
define('ROOT', str_replace('\\', '/',  dirname(__FILE__)).'/');
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


# # # # # # # # # # # # # # # # # A U T O L O A D # # # # # # # # # # # # # # # # #
function autoload($class) {
	if(file_exists($file = ROOT.str_replace('\\', '/', $class).'.class.php'))
		require_once($file);
	else
		Logger::log(new LogEntry("Autoload : file not found : $file", AlertLevel::Error));
}
spl_autoload_register('autoload');
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


# # # # # # # # # # # # # # # A P P L I C A T I O N # # # # # # # # # # # # # # # #
use Core\Application\Application;
use Core\Debugger\AlertLevel;
use Core\Debugger\LogEntry;
use Core\Debugger\Logger;

try
{
	Application::run();

} catch(Exception $e) {
	Logger::log(new LogEntry($e->getMessage(), AlertLevel::Error));
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


Logger::display();

?>